home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
fpkpas92.zip
/
SRCRTL.ZIP
/
RTL
/
DOS
/
WATCH.PP
< prev
Wrap
Text File
|
1997-07-01
|
968b
|
46 lines
unit watch;
interface
uses DOS;
function TotalTime:string;
procedure StartTime;
procedure EndTime;
implementation
var
h0,m0,s0,d0 : word;
h1,m1,s1,d1 : word;
h,m,s,d : word;
function TotalTime:String;
var mm0,ss0,dd0:integer;
st,temp:string;
begin
mm0:=m0;ss0:=s0;dd0:=d0;
if d1 < d0 then begin dd0:=dd0-100;inc(ss0);end;
d:=word(d1-dd0) ; str(d,temp);
if d<10 then st:='0'+temp else st:=temp;
st:='.'+st;
if s1 < ss0 then begin ss0:=ss0-60;inc(mm0);end;
s:=word(s1-ss0) ; str(s,temp);
if s<10 then st:='0'+temp+st else st:=temp+st;
st:=':'+st;
if m1 < mm0 then begin mm0:=mm0-60;inc(h0);end;
m:=word(m1-mm0) ; str(m,temp);
if m<10 then st:='0'+temp+st else st:=temp+st;
st:=':'+st;
h:=word(h1-h0) ; str(h,temp);
if h<10 then st:='0'+temp+st else st:=temp+st;
TotalTime:=st;
end;
procedure StartTime; begin Gettime(h0,m0,s0,d0); end;
procedure EndTime ; begin Gettime(h1,m1,s1,d1); end;
end.